package com.zsrt.day20170506.udp;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.UnknownHostException;

/**
*@author jzh
*@创建时间 2017年5月6日下午4:53:19
*类说明：
*/
public class UDPSocketTest {
	
	public static void main(String[] args) throws Exception {
		DatagramSocket ds=new DatagramSocket();
		String ms="你好，帅哥";
		byte[] b = ms.getBytes();
		InetAddress ip = InetAddress.getByName("192.168.3.167");
		DatagramPacket pd=new DatagramPacket(b, b.length, ip,4321);
		ds.send(pd);
		
	}

}
